import http from "@/utils/http";

export default {
  namespaced: true,

  state: {
    backWaterList: []
  },

  mutations: {
    SETBACKWATERLIST(state, list) {
      state.backWaterList = list;
    }
  },

  actions: {
    getBackWaterList({ commit }, id) {
      let token=sessionStorage.getItem('token')
      http
        .post(
          `/api/login/back_water/get_select?token=${token}`,
          {
            level_id: id
          }
        )
        .then(response => {
          console.log(response);
          let res = response.data.list;
          commit("SETBACKWATERLIST", res);
        });
    }
  }
};
